<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui">

<f:view contentType="text/html">
	<h:head>
		<style type="text/css">@import url(../css/estilo.css);</style>
	</h:head>
	<h:body>
		
		<p:layout fullPage="true" id="adminPrincipal">

			<p:layoutUnit position="top" height="175" id="top_layout" resizable="false"
				closable="false" collapsible="false">
				<div align="center">
					<img src="../imagens/chamado_admin.png" width="1000"></img>
				</div>
			</p:layoutUnit>

			<p:layoutUnit position="bottom" height="30"
				header="Desenvolvido por André Ricardo Gnhoato • João Carlos V. Siqueira • Lubian Carmona • ©2011"
				resizable="false" closable="false" collapsible="true">
			</p:layoutUnit>

			<p:layoutUnit position="left" width="200" header="Menu"
				resizable="true" closable="false" collapsible="true">
				<h:form>
					<p:menu style="width:180px">
						<p:submenu label="Chamadas" icon="ui-icon ui-icon-refresh">
							<p:menuitem value="Total: #{chamadaController.totalChamadas}"
								actionListener="#{chamadaController.direciona}" ajax="false"
								icon="ui-icon ui-icon-refresh" />
						</p:submenu>
						<p:submenu label="Ações" icon="ui-icon ui-icon-gear">
							<p:menuitem value="Máquinas" action="maquina?faces-redirect=true" ajax="false"
								icon="ui-icon ui-icon-gear" />
							<p:menuitem value="Usuários" action="usuario?faces-redirect=true" ajax="false"
								icon="ui-icon ui-icon-gear" />
							<p:menuitem value="Departamentos" action="departamento?faces-redirect=true"
								ajax="false" icon="ui-icon ui-icon-gear" />
							<p:menuitem value="Tipos" action="tipo?faces-redirect=true" ajax="false"
								icon="ui-icon ui-icon-gear" />

						</p:submenu>
						<p:submenu label="Usuário" ajax="false">
							<p:menuitem
								value="Bem-vindo: #{UsuarioController.usuarioLogado.login}" />
							<p:menuitem value="Sair" action="#{UsuarioController.logout}"></p:menuitem>
						</p:submenu>
					</p:menu>
				</h:form>


			</p:layoutUnit>

			<!--    <p:layoutUnit position="right" width="200" header="Right" resizable="true" closable="true" collapsible="true">  -->
			<!--        <h:outputText value="East unit content." />  -->
			<!--    </p:layoutUnit>  -->

			<p:layoutUnit position="center" scrollable="true">
				<h:form>
					<p:panel id="panelChamadas">
						<p:dataTable id="c" var="chamada" value="#{chamadaController.chamadas}"
							paginator="false" rows="10"  dynamic="true"
							selection="#{chamadaController.chamada}" selectionMode="single"
							rowSelectListener="#{chamadaController.onRowSelectNavigateAdmin}">

							<f:facet name="header">  
            				Lista de Chamadas 
        				</f:facet>

							<p:column sortBy="#{chamada.descricao}">
								<f:facet name="header">
									<h:outputText value="Descrição" />
								</f:facet>
								<h:outputText value="#{chamada.descricao}" />
							</p:column>

							<p:column sortBy="#{chamada.data}">
								<f:facet name="header">
									<h:outputText value="Data" />
								</f:facet>
								<h:outputText value="#{chamada.data}" />
							</p:column>

							<p:column sortBy="#{chamada.categoria}">
								<f:facet name="header">
									<h:outputText value="Categoria" />
								</f:facet>
								<h:outputText value="#{chamada.categoria}" />
							</p:column>

							<p:column sortBy="#{chamada.prioridade}">
								<f:facet name="header">
									<h:outputText value="Prioridade" />
								</f:facet>
								<h:outputText value="#{chamada.prioridade}" />
							</p:column>
						</p:dataTable>
					</p:panel>
				</h:form>
			</p:layoutUnit>

		</p:layout>
	<div id="logo"></div>
	</h:body>
</f:view>
</html>
